package com.example.demo.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import com.example.demo.entity.User;

@RestController
public class MovieController {
	@Autowired
	private RestTemplateBuilder restTemplateBuilder;

	@GetMapping("/findUserById/{id}")
	public User findUserById(@PathVariable int id) {
		return this.restTemplateBuilder.build().getForObject("http://localhost:7900/get/" + id, User.class);
	}
}
